aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/[username]/address/+page.server.ts
blob: 2f7841abb6d979ef78c141d0cdebd18e677896c4 (plain) (blame)
1
2
3
4
5
6
7
8
9
import { auth, post } from "$lib/utils";
import { redirect } from "@sveltejs/kit";

export async function load({ cookies, parent }) {
  let user = (await parent()).subject;
  let invoice = { type: "bitcoin" };
  let { id } = await post(`/invoice`, { invoice, user }, auth(cookies));
  redirect(307, `/${user.username}/invoice/${id}`);
}